package poki;
import java.util.Calendar;
import java.util.Date;
import java.util.Set;

import data_creation.SetOfCardSets;
import data_creation.Simulator;
import poki.model.Card;
import poki.model.CardSet;
import poki.model.HandRanking;

@SuppressWarnings("javadoc")
public class Main {

	public static void main(String[] args)
	{
		HandRanking handRanking = new HandRanking();
		
		CardSet cardSet = new CardSet();
		cardSet.addCard(new Card(Card.NA, Card.DIAMOND));
		cardSet.addCard(new Card(Card.NK, Card.DIAMOND));
		cardSet.addCard(new Card(Card.NQ, Card.DIAMOND));
		System.out.println(cardSet);
		Card high = handRanking.checkHighCard(cardSet);
		System.out.println(high);
		CardSet pair = handRanking.checkPair(cardSet);
		System.out.println(pair);
		

		CardSet cardSet2 = new CardSet();
		cardSet2.addCard(new Card(Card.NT, Card.SPADE));
		cardSet2.addCard(new Card(Card.NT, Card.DIAMOND));
		System.out.println(cardSet2);
		
		CardSet cardSet3 = new CardSet();
		cardSet3.addCard(new Card(Card.N9, Card.CLUB));
		cardSet3.addCard(new Card(Card.NT, Card.CLUB));
		CardSet cardSet4 = new CardSet();
		cardSet4.addCard(new Card(Card.NA, Card.HEART));
		cardSet4.addCard(new Card(Card.N4, Card.SPADE));
		SetOfCardSets opponents = new SetOfCardSets();
		opponents.addCardSet(cardSet3);
		//opponents.addCardSet(cardSet4);
		
		CardSet mergedSet = cardSet.merge(cardSet2);
		System.out.println(mergedSet);
		System.out.println("\nDer ermittelte Wert für die Hand ist: " + handRanking.evaluate(mergedSet) + "\n");
		
		CardSet disMergedSet = mergedSet.disMerge(cardSet2);
		System.out.println(disMergedSet);
		
		Simulator sim = new Simulator();
		//CardSet allowedCards = sim.getAllowedCards(cardSet2);
		//System.out.println(allowedCards);
		
		SetOfCardSets boards = new SetOfCardSets();
		//double before = System.currentTimeMillis();
		
		boards = sim.getCardCombinations(5,sim.getAllowedCards(cardSet2.merge(cardSet3)));
		System.out.println(boards.getCardSetList().get(0));
		System.out.println("Es wurden " + boards.getCardSetList().size() + " verschiedene Kartensets erstellt!");
		
		
		/*for(CardSet cardSet3 : boards.getCardSetList()){
			if(cardSet3.getCardList().size() != 5)
			{
				System.out.println(cardSet3);
			}
		}*/
		
		//double[] probabilities = sim.calculateProbabilities(cardSet2, opponents , null);
		
		//System.out.println("Winratio = " + probabilities[0] + " , " + "Splitratio = " + probabilities[1] + " , " + "Loseratio = " + probabilities[2]);
		
		//sim.simulateAllOpponentHandComb(5, sim.getAllowedCards(cardSet2.merge(cardSet3)));
		//double afterwards = System.currentTimeMillis();
		//System.out.println("Die berechnung dauerte " + (afterwards - before)/1000 + " Sekunden");
	}

}
